import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
const RefreshToken = 'vue_admin_template_RefreshToken'
const ExpiresIn = 'expires_in'
// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 获取RefreshToken
export function getRefreshToken() {
  return Cookies.get(RefreshToken)
}
// 获取过期时间
export function getExpiresTime() {
  return Cookies.get(ExpiresIn)
}

// 设置token
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 设置RefreshToken
export function setRefreshToken(token) {
  return Cookies.set(RefreshToken, token)
}
// 设置过期时间
export function setExpiresIn(time) {
  return Cookies.set(ExpiresIn, time)
}
// 移除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 移除RefreshToken
export function removeRefreshToken() {
  return Cookies.remove(RefreshToken)
}
// 移除过期时间
export function removeExpiresIn() {
  return Cookies.remove(ExpiresIn)
}

